package sing.myapp.net

import com.alibaba.fastjson.JSONObject
import okhttp3.RequestBody
import retrofit2.http.*
import sing.core.network.bean.IdNameValueBean
import sing.myapp.net.bean.ApiResponse
import sing.myapp.net.bean.AreaBean
import sing.myapp.net.bean.CompanyBean
import sing.myapp.net.bean.ConstantBean
import sing.myapp.net.bean.ContactBean
import sing.myapp.net.bean.FileBean
import sing.myapp.net.bean.IdentityBean
import sing.myapp.net.bean.PersonBean
import sing.myapp.net.bean.ProvinceCityBean

interface ApiService {

    // 常量配置
    @POST("/api/constant/item")
    suspend fun getConstant(@Body requestBody: RequestBody): ApiResponse<ConstantBean>
    // 上传图片
    @POST("/api/upload")
    suspend fun upload(@Body description : RequestBody): ApiResponse<FileBean>
    // 保存身份证
    @POST("/api/person/identity/updated")
    suspend fun saveIdentity(@Body requestBody: RequestBody): ApiResponse<Int>
    // 获取身份证
    @POST("/api/person/identity/detail")
    suspend fun getIdentityDetail(@Body requestBody: RequestBody): ApiResponse<IdentityBean>
    // 获取省份和城市
    @POST("/api/province/item")
    suspend fun getProvinceCity(@Body requestBody: RequestBody): ApiResponse<ProvinceCityBean>
    // 获取县
    @POST("/api/area/item")
    suspend fun getArea(@Body requestBody: RequestBody): ApiResponse<AreaBean>
    // 获取联系人
    @POST("/api/person/contact/detail")
    suspend fun getContactDetail(@Body requestBody: RequestBody): ApiResponse<ContactBean>
    // 变更联系人
    @POST("/api/person/contact/updated")
    suspend fun updateContact(@Body requestBody: RequestBody): ApiResponse<Int>
    // 用户信息变更
    @POST("/api/person/updated")
    suspend fun updatePerson(@Body requestBody: RequestBody): ApiResponse<Int>
    // 获取用户信息
    @POST("/api/person/detail")
    suspend fun getPersonDetail(@Body requestBody: RequestBody): ApiResponse<PersonBean>
    // 工作信息保存
    @POST("/api/person/job/updated")
    suspend fun updateJob(@Body requestBody: RequestBody): ApiResponse<Int>
    // 工作详情
    @POST("/api/person/job/detail")
    suspend fun getJobDetail(@Body requestBody: RequestBody): ApiResponse<CompanyBean>
}